using System;
using ValidationFramework;

namespace ExampleLibraryCSharp
{

	public class NumberConversionRuleAttributeExample
    {
        private static readonly RuntimeMethodHandle doSomethingHandle =
			typeof(NumberConversionRuleAttributeExample).GetMethod("DoSomething").MethodHandle;

        //Defined ErrorMessage
		[NumberConversionRule(TypeCode.Decimal,
		  ErrorMessage = "Invalid decimal format.")]
        public string DecimalString
        {
            get;
            set;
        }

        public void ParseDecimal(
		  [NumberConversionRule(TypeCode.Decimal)] string decimalString)
        {
			ParameterValidationManager.ThrowException(this, doSomethingHandle, decimalString);
        }
    }
}